package com.yf.dxs.wo.rep;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public  class WR {

    private Code code;


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Code {

        @JsonProperty("errcode")
        private Integer errCode;

        @JsonProperty("errmsg")
        private String errMsg;

    }




    public static WR ok(){
        Code wcode = new Code(0,"success");
        WR wr = new WR(wcode);
        return wr;
    }

    public static WR error(String msg){
        Code wcode = new Code(1,msg);
        WR wr = new WR(wcode);
        return wr;
    }


}
